<?php

class Resource extends CApplicationComponent
{

    public $config = array();

    public function init()
    {
        parent::init();
        $tempPath = Yii::getPathOfAlias('application.config.resource') . '.php';
        $this->config = require $tempPath;
    }

    public function path($pathGroup)
    {
        $path = null;
        if (array_key_exists($pathGroup, $this->config['pathGroup'])) {
            $path = $this->config['pathGroup'][$pathGroup]['path'];
        }
        return $this->host() . $path;
    }

    public function host()
    {
        return $this->config['host'];
    }
}